<!DOCTYPE html>
<html  lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="central/include::header('总控台')" />
    <th:block th:include="central/include::central" />
    <style>
        .dashboard-stat{
            cursor:pointer
        }
        .ibox-title{
            padding: 10px 10px 7px;
        }
    </style>
</head>
<body class="gray-bg">
<div class="tpl-page-container">

    <div class="">
        <div class="ibox-title">
            <h5  class="header-title">总控台</h5>
            <div class="ibox-tools">
                <a class="collapse-link" href="/index">
                    <i class="am-icon-angle-left"></i>
                    <i class="am-icon-angle-left"></i>
                    后台首页
                </a>
            </div>
        </div>
        <div class="ibox-content">
            <div th:each="i:${#numbers.sequence(0, line-1)}" th:if="${menus!=null && menus.size()>0}">
                <div class="row" >
                    <div class="col-lg-3 col-md-6 col-sm-12" th:each="c:${#numbers.sequence((i*column)+1,(i+1)*column)}" th:with="index=${c>menus.size()?menus.size()-1:c-1}">
                        <div th:class="'dashboard-stat '+${(menu.remark==null||menu.remark=='')?'blue':menu.remark}" th:with="menu=${menus[index]}" th:if="${menus.size()>=c}"
                             th:data-url="${menu.url}" onclick="toUrl(this)">
                            <div class="visual">
                                <i th:class="${(menu.icon==null||menu.icon=='')?'am-icon-comments-o':menu.icon}"></i>
                            </div>
                            <div class="details">
                                <div class="number" th:text="${menu.menuName}">  </div>
                                <div class="desc"> </div>
                            </div>
                            <span class="more"  th:text="'查看'+${menu.menuName}">
                            <i class="m-icon-swapright m-icon-white"></i>
                        </span>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div th:if="${#servletContext.getAttribute('ignoreFooter')}" class="footer" style="padding: 0px;margin: 0px;">
        <div class="pull-right">© [[${#servletContext.getAttribute('copyrightYear')}]] TOPNC Copyright &nbsp;&nbsp;</div>
    </div>
</div>

<th:block th:include="include :: footer" />

<script th:inline="javaScript">
    function toUrl(_this){
        let $this = $(_this);
        let url = $this.attr("data-url");
        window.location.href = url ;
    }

    $(function(){
        setsize();
    });
    function setsize() {
        var numclass = $(".number");
        for (var i = 0; i < numclass.length; i++) {
            var textlen = numclass[i].innerText.length;
            if (textlen > 10) {
                numclass[i].setAttribute("style", "font-size: 21px");
            } else if (textlen > 9) {
                numclass[i].setAttribute("style", "font-size: 24px");
            } else if (textlen > 8) {
                numclass[i].setAttribute("style", "font-size: 26px");
            } else if (textlen > 7) {
                numclass[i].setAttribute("style", "font-size: 28px");
            } else if (textlen > 6) {
                numclass[i].setAttribute("style", "font-size: 32px");
            }else if (textlen <=6)
            {
                numclass[i].setAttribute("style", "font-size: 34px");
            }
        }
    }
</script>
</body>
</html>
